import Vue from 'vue'
import Vuex from 'vuex'
import createLogger from 'vuex/dist/logger'

import * as actions from './actions'
import * as types from './mutation-types'

Vue.use(Vuex)

const plugins = [createLogger()]

const state = {
  removeID: ' ',
  settingEnable: {
    meiri: true,
    JY_DIRECTION: true,
    SQ_JYB_DYNAMIC: true,
    SQ_MEDAL_DYNAMIC: true,
    USER_WON_INFO: true,
    JXNG_NEW_ARTICLE: true,
    TS_INFO: true,
    liangrong: true,
    // tuandui: true,
    GM_LOCAL: true,
    // dingyue: true,
    JYB_OF_FOLLOWEES: true,
    xiangtong: true,
    yanlun: true,
    baoming: true
  }
}

const mutations = {
  [types.SET_SETTING_ENABLE] (state, data) {
    console.log(data)
    state.settingEnable[data.name] = data.value
    console.log(state.settingEnable)
  },
  [types.SET_REMOVECARDID] (state, data) {
    state.removeID = data
  }
}

export default new Vuex.Store({
  state,
  mutations,
  actions,
  plugins
})
